package com.jianfeiliao.portfolio;

import com.jianfeiliao.portfolio.page.ErrorPage;
import com.jianfeiliao.portfolio.page.aboutpage.AboutPage;
import com.jianfeiliao.portfolio.page.contactpage.ContactPage;
import com.jianfeiliao.portfolio.page.homepage.HomePage;
import com.jianfeiliao.portfolio.page.projectspage.ProjectsPage;
import com.jianfeiliao.portfolio.page.resumepage.ResumePage;
import org.apache.wicket.protocol.http.HttpSessionStore;
import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.session.ISessionStore;

/**
 * Application object for your web application. If you want to run this application without
 * deploying, run the Start class.
 * 
 * @see com.jianfeiliao.portfolio.Start#main(String[])
 */
public class WicketApplication extends WebApplication {
    /**
     * Constructor
     */
    public WicketApplication() {
    }
    
    @Override
    protected void init() {
        super.init();
        getMarkupSettings().setStripWicketTags(true);
        
        mount(new NonVersionedHybridUrlCodingStrategy("/home", HomePage.class));
        mount(new NonVersionedHybridUrlCodingStrategy("/projects", ProjectsPage.class));
        mount(new NonVersionedHybridUrlCodingStrategy("/resume", ResumePage.class));
        mount(new NonVersionedHybridUrlCodingStrategy("/about", AboutPage.class));
        mount(new NonVersionedHybridUrlCodingStrategy("/contact", ContactPage.class));
        mount(new NonVersionedHybridUrlCodingStrategy("/error", ErrorPage.class));
    }
    
    /**
     * @see org.apache.wicket.Application#getHomePage()
     */
    @Override
    public Class<HomePage> getHomePage() {
        return HomePage.class;
    }
    
    @Override
    protected ISessionStore newSessionStore() {
        // for appengine deployment
        return new HttpSessionStore(this);
    }
}
